import React from 'react';
import PropTypes from 'prop-types';
import { Row, Col, Form, Input, Divider } from 'antd';
import { getPath } from '../../utils';
import './main-content.less';
const FormItem = Form.Item;
const Search = Input.Search;
const formItemLayout = {
  labelCol: {
    span: 7
  },
  wrapperCol: {
    span: 15
  }
};
function gotoLink(link, router) {
  router.push(link);
}
const filter = ({ productInfo, handleSearch }) => {
  const {
    currentOwner,
    type,
    lairageTime,
    fattenedTime,
    days,
    kLairageTime,
    kCondition
  } = productInfo;
  return (
    <div className="table-wrap">
      <p className="title">家畜基本信息</p>
      <div className="main-table" style={{borderBottom: '1px solid #318DEF'}}>
        <Row>
          <Col span={6}>
            <FormItem label="耳标编号：" {...formItemLayout} style={{marginBottom:0}}>
              <Search
                placeholder=""
                onSearch={value => handleSearch(value)}
                enterButton
              />
            </FormItem>
          </Col>
        </Row>
        <Divider dashed></Divider>
        <Row>
          <Col span={6}>
            <FormItem label="养殖场：" {...formItemLayout}>
              <Input disabled={true} value={currentOwner} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="品种：" {...formItemLayout}>
              <Input disabled={true} value={type} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="入栏时间：" {...formItemLayout}>
              <Input disabled={true} value={lairageTime} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="入栏时间：" {...formItemLayout}>
              <Input disabled={true} value={fattenedTime} />
            </FormItem>
          </Col>
        </Row>
        <Row>
          <Col span={6}>
            <FormItem label = '入场批次：' {...formItemLayout}>
              <Input disabled={true} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="生长天数：" {...formItemLayout}>
              <Input disabled={true} value={days} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="入场时间" {...formItemLayout}>
              <Input disabled={true} value={kLairageTime} />
            </FormItem>
          </Col>
          <Col span={6}>
            <FormItem label="宰前检疫" {...formItemLayout}>
              <Input disabled={true} value={kCondition} />
            </FormItem>
          </Col>
        </Row>
      </div>
    </div>
  );
};
export default filter;
